/*********************************************************
          File Name:10.29.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon 14 Mar 2016 07:37:10 PM CST
**********************************************************/

#include <algorithm>
#include <iostream>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>

using namespace std;

int main()
{
    ifstream in("text.txt");
    istream_iterator<string> iter(in), eof;
    vector<string> vs(iter, eof);
    for_each(vs.begin(), vs.end(), [](const string &s){ cout << s << " "; });
    cout << endl;
    return 0;
}
